Micron Document
🎖️GitЯра🎖️

Node / meshtastic / Meshtastic-Android / files / .github / agents / speckit.git.feature.agent.md

Displaying Raw • View renderedDownload

.github/agents/speckit.git.feature.agent.md gh-readonly-queue/main/pr-6597-a885127337f8d0abf09f1f5537560ed7af85e32d (34896a4a) Text, 3.33 KB

---
Tc9d1d9description: Create a feature branch with sequential or timestamp numbering
Tc9d1d9---


<!-- Extension: git -->
<!-- Config: .specify/extensions/git/ -->
Tc9d1d9# Create Feature Branch

Create and switch to a new git feature branch for the given specification. This command handles **branch creation only** — the spec directory and files are created by the core Ta5d6ff`/speckit.specify` workflow.

Tc9d1d9## User Input

Ta5d6ff```Ta5d6fftext
$ARGUMENTS
Ta5d6ff```

You **MUST** consider the user input before proceeding (if not empty).

Tc9d1d9## Environment Variable Override

If the user explicitly provided Ta5d6ff`GIT_BRANCH_NAME` (e.g., via environment variable, argument, or in their request), pass it through to the script by setting the Ta5d6ff`GIT_BRANCH_NAME` environment variable before invoking the script. When Ta5d6ff`GIT_BRANCH_NAME` is set:
Tff7b72- The script uses the exact value as the branch name, bypassing all prefix/suffix generation
Tff7b72- Ta5d6ff`--short-name`, Ta5d6ff`--number`, and Ta5d6ff`--timestamp` flags are ignored
Tff7b72- Ta5d6ff`FEATURE_NUM` is extracted from the name if it starts with a numeric prefix, otherwise set to the full branch name

Tc9d1d9## Prerequisites

Tff7b72- Verify Git is available by running Ta5d6ff`git rev-parse --is-inside-work-tree 2>/dev/null`
Tff7b72- If Git is not available, warn the user and skip branch creation

Tc9d1d9## Branch Numbering Mode

Determine the branch numbering strategy by checking configuration in this order:

Tff7b721. Check Ta5d6ff`.specify/extensions/git/git-config.yml` for Ta5d6ff`branch_numbering` value
Tff7b722. Check Ta5d6ff`.specify/init-options.json` for Ta5d6ff`branch_numbering` value (backward compatibility)
Tff7b723. Default to Ta5d6ff`sequential` if neither exists

Tc9d1d9## Execution

Generate a concise short name (2-4 words) for the branch:
Tff7b72- Analyze the feature description and extract the most meaningful keywords
Tff7b72- Use action-noun format when possible (e.g., "add-user-auth", "fix-payment-bug")
Tff7b72- Preserve technical terms and acronyms (OAuth2, API, JWT, etc.)

Run the appropriate script based on your platform:

Tff7b72- **Bash**: Ta5d6ff`.specify/extensions/git/scripts/bash/create-new-feature.sh --json --short-name "<short-name>" "<feature description>"`
Tff7b72- **Bash (timestamp)**: Ta5d6ff`.specify/extensions/git/scripts/bash/create-new-feature.sh --json --timestamp --short-name "<short-name>" "<feature description>"`
Tff7b72- **PowerShell**: Ta5d6ff`.specify/extensions/git/scripts/powershell/create-new-feature.ps1 -Json -ShortName "<short-name>" "<feature description>"`
Tff7b72- **PowerShell (timestamp)**: Ta5d6ff`.specify/extensions/git/scripts/powershell/create-new-feature.ps1 -Json -Timestamp -ShortName "<short-name>" "<feature description>"`

**IMPORTANT**:
Tff7b72- Do NOT pass Ta5d6ff`--number` — the script determines the correct next number automatically
Tff7b72- Always include the JSON flag (Ta5d6ff`--json` for Bash, Ta5d6ff`-Json` for PowerShell) so the output can be parsed reliably
Tff7b72- You must only ever run this script once per feature
Tff7b72- The JSON output will contain Ta5d6ff`BRANCH_NAME` and Ta5d6ff`FEATURE_NUM`

Tc9d1d9## Graceful Degradation

If Git is not installed or the current directory is not a Git repository:
Tff7b72- Branch creation is skipped with a warning: Ta5d6ff`[specify] Warning: Git repository not detected; skipped branch creation`
Tff7b72- The script still outputs Ta5d6ff`BRANCH_NAME` and Ta5d6ff`FEATURE_NUM` so the caller can reference them

Tc9d1d9## Output

The script outputs JSON with:
Tff7b72- Ta5d6ff`BRANCH_NAME`: The branch name (e.g., Ta5d6ff`003-user-auth` or Ta5d6ff`20260319-143022-user-auth`)
Tff7b72- Ta5d6ff`FEATURE_NUM`: The numeric or timestamp prefix used

Served by rngit 1.5.2 - Generated in 0.06s